interface Point {
  x: number = 1
  y: number = 2
}

interface Point2D {
  x: number = 1
  y: number = 2
}

interface Point3D {
  x: number = 1
  y: number = 2
  z: number = 3
}

let p1 = new Point();
let p2 = new Point2D();

// 类型结构相同的接口可以相互赋值
p1 = p2;
p2 = p1;

interface Point4D {
  x: number = 1
  y: number = 2
  z: number = 3
  w: number = 4
}

// 类型结构不同的接口不可以相互赋值, 属性多的接口可以赋值给属性少的接口
let p3 = new Point3D();
let p4 = new Point4D();
p3 = p4;